//
//  MahjongControlPlayerView.m
//  Mahjong
//
//  Created by 饶首建 on 17/6/30.
//  Copyright © 2017年 com.ikamobile.com. All rights reserved.
//

#import "MahjongControlPlayerView.h"

@implementation MahjongControlPlayerView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (void)awakeFromNib{
    [super awakeFromNib];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id  _Nonnull sender) {
        if (_playerTapBlock) {
            _playerTapBlock(_nameLabel.text);
        }
    }];
    [self addGestureRecognizer:tap];
    
    _avatarImageView.layer.cornerRadius = _avatarImageView.frame.size.width/2;
    _avatarImageView.layer.masksToBounds = YES;
}


+(instancetype)mahjongControlPlayerView{
    return [[[NSBundle mainBundle] loadNibNamed:@"MahjongControlPlayerView"
                                          owner:nil options:nil]lastObject];
}


@end
